home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr48 / tsbat146.zip / ZOO2ZIP.BAT < prev   
DOS Batch File  |  1992-08-30  |  4KB  |  170 lines

  1. echo off
  2. rem
  3. rem Do not distribute ZOO2ZIP.BAT separately from the rest of the package
  4. rem
  5.  
  6. rem If you get an "Out of environment space" message, increase your
  7. rem environment space by using shell configuration in config.sys:
  8. rem Example: shell=c:\bin\command.com /e:1024 /p
  9.  
  10. echo.
  11. echo ┌───────────────────────────────────────────────────────────────┐
  12. echo │ Convert and datestamp a single .zoo to .zip file with comment │
  13. echo │ By Prof. Timo Salmi, ts@chyde.uwasa.fi, Sun 30-Aug-1992       │
  14. echo └───────────────────────────────────────────────────────────────┘
  15. if not "%1"=="" goto _continue
  16. echo.
  17. echo Usage: ZOO2ZIP PackageName [/r(eplace the old .zoo with the new .zip)]
  18. echo Use no drive name! No extension!
  19. echo        ┌───────────────┐
  20. echo        │ NO WILDCARDS! │
  21. echo        └───────────────┘
  22. echo.
  23. echo When using for the first time:
  24. echo  1) Make zoo.exe, pkzip.exe, and scan.exe available (not provided)
  25. echo  2) Make a new directory e:\arczip\zip for converted files
  26. echo  3) Edit your own zip-file comment to e:\arczip\comment.txt (not provided)
  27. echo  4) Carefully adjust the paths in the batch, if necessary
  28. echo.
  29. echo Usually:
  30. echo  Place the .zoo file in directory e:\arczip\arc
  31. echo  And run normally
  32. echo.
  33. echo.
  34. goto _out
  35.  
  36. :_continue
  37. rem Do the necessary program and comment files exist
  38. if not exist c:\tools\pkzip.exe goto _err1
  39. if not exist c:\box\boxtools\zoo.exe goto _err2
  40. if not exist e:\arczip\comment.txt goto _err3
  41. if not exist e:\arczip\zip\nul goto _err8
  42. if not exist c:\tools\scan.exe goto _err11
  43.  
  44. rem Check that wilrcards have not been used
  45. for %%f in (%1) do if "%1"=="%%f" goto :_testext
  46. echo No wildcards allowed in the file name %1
  47. goto _out
  48.  
  49. rem Check that no extension was used
  50. :_testext
  51. set _exten=%1
  52. :_nextchar
  53. set _prev=%_exten%
  54. for %%f in (/%_exten%) do set _exten=%%f
  55. if ".%_exten%"=="%_prev%" goto _extfound
  56. if not "%_exten%"=="%_prev%" goto _nextchar
  57. goto _noext
  58.  
  59. :_extfound
  60. echo No extension allowed in the file name %1
  61. goto _out
  62.  
  63. :_noext
  64. set _exten=
  65. rem Build the names for source .zoo and target .zip files
  66. set _filea=e:\arczip\arc\%1.zoo
  67. set _filez=e:\arczip\zip\%1.zip
  68. if not exist %_filea% goto _err4
  69. if exist %_filez% goto _err5
  70. if not exist e:\arczip\tmp$$$\nul md e:\arczip\tmp$$$
  71. if exist e:\arczip\tmp$$$\*.* goto _err9
  72.  
  73. rem Test .zoo archive integrity
  74. c:\box\boxtools\zoo -test %_filea%
  75. if errorlevel==1 goto _err10
  76.  
  77. rem Unpack and check for viruses
  78. e:
  79. cd \arczip\tmp$$$
  80. c:\box\boxtools\zoo e %_filea% 
  81. c:\tools\scan /m /nomem /x e:\arczip\tmp$$$
  82. if errorlevel==1 goto _err12
  83.  
  84. rem Convert, use the date of the latest file, not the current date
  85. pkzip -a %_filez% e:\arczip\comment.txt
  86. pkzip -z %_filez% < e:\arczip\comment.txt
  87. pkzip -d %_filez% comment.txt
  88. pkzip -br:\ -u -m -o %_filez% e:\arczip\tmp$$$\*.*
  89. pkzip -v %_filez%
  90. dir %_filez%
  91. cd \arczip
  92. rd e:\arczip\tmp$$$
  93.  
  94. rem State of the /r switch for replacing the old .zoo file
  95. if "%2"=="/r" goto _replace
  96. if "%2"=="/R" goto _replace
  97. goto _out
  98.  
  99. rem Replace the old .zoo file with the new .zip file
  100. :_replace
  101. echo.
  102. echo To delete %_filea% press any key
  103. echo To cancel, use the Break key now
  104. pause >nul
  105. if not exist %_filez% goto _err6
  106. if exist %_filea% del %_filea%
  107. if exist %_filea% goto _err7
  108. echo.
  109. echo File %_filea% deleted
  110. goto _out
  111.  
  112. :_err1
  113. Echo File c:\tools\pkzip.exe not found
  114. goto _out
  115.  
  116. :_err2
  117. Echo File c:\box\boxtools\zoo.exe not found
  118. goto _out
  119.  
  120. :_err3
  121. Echo File e:\arczip\comment.txt not found
  122. goto _out
  123.  
  124. :_err4
  125. Echo File %_filea% not found
  126. echo.
  127. echo Usage: ZOO2ZIP PackageName [/r(eplace the old .zoo with the new .zip)]
  128. echo Use no drive name! No extension!
  129. echo        ┌───────────────┐
  130. echo        │ NO WILDCARDS! │
  131. echo        └───────────────┘
  132. goto _out
  133.  
  134. :_err5
  135. Echo File %_filez% already exists
  136. goto _out
  137.  
  138. :_err6
  139. Echo ZOO2ZIP aborted: File %_filez% not found
  140. goto _out
  141.  
  142. :_err7
  143. Echo ZOO2ZIP aborted: Disk or file %_filea% is readonly
  144. goto _out
  145.  
  146. :_err8
  147. Echo Error: Directory e:\arczip\zip does not exist
  148. goto _out
  149.  
  150. :_err9
  151. Echo Error: Directory e:\arczip\tmp$$$ is not empty
  152. goto _out
  153.  
  154. :_err10
  155. Echo ZOO2ZIP aborted: Error in %_filea%
  156. goto _out
  157.  
  158. :_err11
  159. Echo File c:\tools\scan.exe not found
  160. goto _out
  161.  
  162. :_err12
  163. Echo ZOO2ZIP aborted: Scan reports problems in c:\arczip\tmp$$$
  164. goto _out
  165.  
  166. :_out
  167. set _filea=
  168. set _filez=
  169. echo on
  170.